<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-18 20:29:14
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-18 20:36:14
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 编写函数，判断一个字符串是否是 “可回文字符串” */
        function isReverse(str){
            var str1=str.split("").reverse().join("");
            console.log(str1);
            
            if(str==str1){
                return true;
            }else{
                return false;
            }
        }
        var str="abcba";
        console.log(isReverse(str));
        
    </script>
</body>
</html>